<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ include file="./common/taglibs.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<HTML xmlns="http://www.w3.org/1999/xhtml">
	<HEAD>
		<META content="IE=7.0000" http-equiv="X-UA-Compatible">
		<TITLE>编辑物品-91拍手|清华二手网|清华二手市场|清华二手物品交易</TITLE>
		<link charset="utf-8" type="text/css" href="css/common.css"
			rel="stylesheet" />
<link type="text/css" href="css/jquery-ui-1.8.14.custom.css" />
		<META content="text/html; charset=utf-8" http-equiv=Content-Type>
		<META name=Description
			content=厦门二手频道是网上厦门二手市场，提供免费的厦门二手信息发布，有闲置物品旧货出售求购交换需求，请来赶集厦门二手网。>
		<META name=GENERATOR content="MSHTML 8.00.7601.17537">
<script src="js/jquery-1.5.1.min.js"></script>
<script type="text/javascript">
function cancelFile(){
document.forms["productForm"].reset();
document.getElementById("attachmentDiv").style.display="block";
document.getElementById("conditionTable").style.display="none";
		 document.getElementById("continue").style.display="none";		
		 document.getElementById("cancel").style.display="none";
		 document.getElementById("replay").style.display="block";
var t=doucument.getElementById(conditionTable); 
  t.parent.remove(t); 
}
		var jj=0;
		<!--动态增加上传附件-->
		function readdFile1(){
		 document.getElementById("replay").style.display="none";
		 document.getElementById("attachmentDiv").style.display="none";
		 document.getElementById("conditionTable").style.display="block";
		 document.getElementById("continue").style.display="block";		
		 document.getElementById("cancel").style.display="block";		 
	 currRow=conditionTable.insertRow();
     cellc=currRow.insertCell();
     cellcContext= "<input type='File' NAME='fileList'>&nbsp;&nbsp;<button onclick='removeFile();'>删除</button><br>";
     cellc.innerHTML=cellcContext;
     
     //alert(cellcContext);
	    
	}
	function addFile11(){
	 currRow=conditionTable.insertRow();
     cellc=currRow.insertCell();
     cellcContext= "<input type='File' NAME='fileList'>&nbsp;&nbsp;<button onclick='removeFile();'>删除</button><br>";
     cellc.innerHTML=cellcContext;
     
     //alert(cellcContext);
	    
	}
	<!--在表的td中增加-->
	function findTD(o){
if (o.nodeName=="TR"||o.nodeName=="TABLE") return;
if(o.nodeName=="TD")
return (o);
else
return (o.parentElement);
}

<!--删除一个附件-->
function removeFile(){
  o = findTD(event.srcElement);
  //alert(o.parentElement.rowIndex*1);
conditionTable.deleteRow(o.parentElement.rowIndex*1);


}
</script>		
<style type="text/css">
#type {
	font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
	width: 100%;
	border-collapse: collapse;
}

#type td,#type th {
	font-size: 1.4em;
	padding: 3px 7px 14px 7px;
}

#type th {
	font-size: 16;
	text-align: left;
	padding-top: 5px;
	padding-bottom: 4px;
}

</style>
<script>
var flag=true;
function validatetitle()
{
var title2=$.trim(jQuery("#title").val());
	if(title2=="")
		{
			jQuery("#tip_span_title").html("<label><font color='red' size='0.8em'>标题不能为空喔！</font></label>");
			jQuery("#tip_span_title").addClass("validatorError");
		flag=false;
		}
		else
		{
			jQuery("#tip_span_title").html("");
			flag=false;
		}
}
function validateprice(){
var price2=$.trim(jQuery("#price").val());
if(price2=="")
		{
			jQuery("#tip_span_price").html("<label><font color='red' size='0.8em'>卖个好价钱吧！</font></label>");
			jQuery("#tip_span_price").addClass("validatorError");
	flag=false;
		}
		else
		{
			jQuery("#tip_span_price").html("");
			flag=true;
		}
}
function validatedescription(){
	var description2=$.trim(jQuery("#description").val());
if(description2=="")
		{
			jQuery("#tip_span_description").html("<label><font color='red' size='0.8em'>写点描述可以增加成交几率喔！</font></label>");
			jQuery("#tip_span_description").addClass("validatorError");
	flag=false;
		}
		else
		{
			jQuery("#tip_span_description").html("");
			flag=true;
		}
}
function validatetelorqq(){
		var tel2=$.trim(jQuery("#tel").val());
	var qq2=$.trim(jQuery("#qq").val());
if(tel2==""&&qq2=="")
		{
			jQuery("#tip_span_phone").html("<label><font color='red' size='0.8em'>至少填写一项联系方式！</font></label>");
			jQuery("#tip_span_phone").addClass("validatorError");
	flag=false;
		}
		else
		{
			jQuery("#tip_span_phone").html("");
			flag=true;
		}
}
function validatecontactor(){
		var contactor2=$.trim(jQuery("#contactor").val());
if(contactor2=="")
		{
			jQuery("#tip_span_contactor").html("<label><font color='blue' size='0.8em'>您可以填写联系人称呼</font></label>");
			jQuery("#tip_span_contactor").addClass("validatorError");
	flag=false;
		}
		else
		{
			jQuery("#tip_span_contactor").html("");
			flag=true;
		}
}
function validateschool(){
		var school2=$.trim(jQuery("#school").val());
if(school2=="")
		{
			jQuery("#tip_span_school").html("<label><font color='red' size='0.8em'>您所在的学院是？</font></label>");
			jQuery("#tip_span_school").addClass("validatorError");
	flag=false;
		}
		else
		{
			jQuery("#tip_span_school").html("");
			flag=true;
		}
}
function validatedorm(){
		var dorm2=$.trim(jQuery("#dorm").val());
if(dorm2=="")
		{
			jQuery("#tip_span_dorm").html("<label><font color='red' size='0.8em'>请填写交易地点！</font></label>");
			jQuery("#tip_span_dorm").addClass("validatorError");
	flag=false;
		}
		else
		{
			jQuery("#tip_span_dorm").html("");
			flag=true;
		}
}

function check(form)
			{	
				if(form.title.value == "")
				{
					alert("标题不能为空！");
					form.title.focus();
					return false;
				}
				if(form.price.value == "")
				{
					alert("请填写价格！");
					form.price.focus();
					return false;
				}
				if(form.description.value == "")
				{
					alert("请填写描述！");
					form.description.focus();
					return false;
				}
				if(form.tel.value == ""&&form.qq.value=="")
				{
					alert("请至少填写一项联系方式！");
					form.tel.focus();
					return false;
				}
				if(form.school.value == "")
				{
					alert("请填写所在学院！");
					form.school.focus();
					return false;
				}
				if(form.dorm.value == "")
				{
					alert("请填写交易地点！");
					form.dorm.focus();
					return false;
				}
				form.submit.disabled = true;
			}

</script>
	</HEAD>
	<BODY>
		<s:include value="include/top.jsp"></s:include>
		<DIV class=nav>
			<DIV id=logo>
				<A href="index.jsp"><IMG src="image/pub.png"> </A>
			</DIV>
		</DIV>

		<DIV class=wrapper>
			<!--mainBox -->
			<DIV class=mainBox>
				<DIV class=subNav>
					<A onClick="newWupinClick('top',event,'homepage');"
						href="http://xm.ganji.com/">清华91拍手网</A> &gt;
					<A onclick="newWupinClick('top',event,'this');"
						href="http://xm.ganji.com/wu/">清华校内二手物品交易</A><A
						style="COLOR: #24d; MARGIN-LEFT: 50px; FONT-SIZE: 12px; FONT-WEIGHT: normal"
						href="http://www.ganji.com/mobile/client.php" target=_blank>立即注册享受二手交易乐趣<IMG
							src="image/hot.png"> </A>
					<!--<span class="icontm">个人闲置宝贝轻松转让！每天上万超值物品等你来淘~</span>-->
				</DIV>
				<DIV class=content>
					<div class="release-step">
						<div class="head-info clearfix">
							<div class="cat majorCategory" id="secondmarket_major">
								<DIV class="top-info blue-box">
									<span id="category_text">①二手交易→</span>
									<span id="major_text">②选择小类<A
										href="<s:url action="goChooseTypeAction"></s:url>">(重选)</A>→</span>
									<span class="green">③填写详情</span>
									<DIV class="rj blt"></DIV>
									<DIV class="rj blb"></DIV>
									<DIV class="rj brt"></DIV>
									<DIV class="rj brb"></DIV>
								</DIV>
								<s:form id="productForm" action="updateGoodAction" method="post"
									enctype="multipart/form-data" onsubmit="return check(this);">
<s:hidden name="good.id"></s:hidden>
<s:hidden name="user.id"></s:hidden>
<s:hidden name="catalog.id"></s:hidden>
<s:hidden name="catalog.name"></s:hidden>
<s:hidden name="address.id"></s:hidden>
									<TABLE border=0 cellSpacing=0 cellPadding=0 width="85%">
										<TR id=id_tr_title>
											<TD width="2%">
												<I>* </I>
											</TD>
											<TD width="10%">
												标题
											</TD>
											<TD width="88%">
<s:textfield id="title" maxLength="30" size="50" name="good.title" onblur="validatetitle()"/>
												<SPAN id=tip_span_title></SPAN>
											</TD>
										</TR>
<TR id=id_tr_deal_type>
											<TD>
												<I>* </I>
											</TD>
											<TD>
												状态
											</TD>
											<TD class=space>
												<s:radio id="stauts" name="good.status"
																	list="%{#{'1':'正常显示','0':'删除'}}" theme="simple"></s:radio>
												<SPAN id=tip_span_status></SPAN>
											</TD>
										</TR>
										<TR id=id_tr_deal_type>
											<TD>
												<I>* </I>
											</TD>
											<TD>
												供需
											</TD>
											<TD class=space>
												<s:radio id="type" name="good.type"
																	list="%{#{'0':'转让','1':'求购'}}" theme="simple"></s:radio>
												<SPAN id=tip_span_type></SPAN>
											</TD>
										</TR>
										<TR id=id_tr_agent>
											<TD>
												<I>* </I>
											</TD>
											<TD>
												发布人
											</TD>
											<TD class=space>
			<s:radio id="publisher" name="good.publisher" list="%{#{'个人':'个人','单位':'单位'}}" theme="simple"></s:radio>
												<SPAN id=tip_span_publisher></SPAN>
											</TD>
										</TR>
									<TR id=id_tr_title>
											<TD width="2%">
												<I>* </I>
											</TD>
											<TD width="10%">
												类型
											</TD>
											<TD width="88%">
<s:property id="name" value="catalog.name" /><A
										href="<s:url action="goChooseTypeAction"></s:url>" style="display:none">(重选)</A>
												<SPAN id=tip_span_type></SPAN>
											</TD>
										</TR>
										<TR id=id_tr_price>
											<TD>
												<I>* </I>
											</TD>
											<TD>
												价格
											</TD>
											<TD>
<s:textfield id="price" maxLength="8" size="8" name="good.price" onblur="validateprice()"/>
												&nbsp;元
												<SPAN id=tip_span_price></SPAN>
											</TD>
										</TR>
										<TR>
											<TD vAlign=top>
												<I>* </I>
											</TD>
											<TD vAlign=top>
												描述
											</TD>
											<TD>
<s:textarea  id="description" cols="42" rows="6" name="good.description" onblur="validatedescription()"></s:textarea>
												<SPAN id=tip_span_description></SPAN>
											</TD>
										</TR>
										<TR>
											<TD>
												<I>* </I>
											</TD>
											<TD>
												联系电话
											</TD>
											<TD width="88%">
<s:textfield id="tel" maxLength="16" size="20" name="good.tel" onblur="validatetelorqq()"/>
												&nbsp;或者QQ&nbsp;
<s:textfield id="qq"  maxLength="30" size="20" name="good.qq" onblur="validatetelorqq()"/>
												<SPAN id=tip_span_phone></SPAN>
											</TD>
										</TR>
										<TR>
											<TD></TD>
											<TD>
												联系人
											</TD>
											<TD>
<s:textfield id="contactor" maxLength="10" size="50" name="good.contactor" onblur="validatecontactor()"/>
												<SPAN id=tip_span_contactor></SPAN>
											</TD>
										</TR>
<TR id=id_tr_title>
											<TD width="2%">
												<I>* </I>
											</TD>
											<TD width="10%">
												学院
											</TD>
											<TD width="88%">
<s:textfield id="school" maxLength="20" size="50" name="address.school" onblur="validateschool()"/>
												<SPAN id=tip_span_school></SPAN>
											</TD>
										</TR>
<TR id=id_tr_title>
											<TD width="2%">
												<I>* </I>
											</TD>
											<TD width="10%">
												楼栋
											</TD>
											<TD width="88%">
<s:textfield id="dorm" maxLength="20" size="50" name="address.dorm" onblur="validatedorm()"/>
												<SPAN id=tip_span_dorm></SPAN>
											</TD>
										</TR>
<TR id=id_tr_title>
											<TD width="2%">
												<I>  </I>
											</TD>
											<TD width="10%">
												宿舍
											</TD>
											<TD width="88%">
<s:textfield id="room" maxLength="20" size="50" name="address.room" />
												<SPAN id=tip_span_title></SPAN>
											</TD>
										</TR>
										<TR>
											<TD>
												&nbsp;
											</TD>
											<TD vAlign=top>
												上传照片
											</TD>
<td>
<div id=attachmentDiv>
							<s:iterator value="photoList" status="photo">
								<a href="<s:url action="download"> 
                     			<s:param name="fileName"> 
                       			 	<s:property value="filelink"/> 
                    			</s:param> 
								<s:param name="originalFileName"> 
                       			 	<s:property value="filename"/> 
                    			</s:param> 
                					</s:url>">
									<font color="blue"><IMG width="280" height="208"
										alt=<s:property value="good.title"/>
										src="upload<s:property value='filelink'/>"> </font> </a>
							</s:iterator>
						</div>
												<table id=conditionTable border=0>
						</table>
						<a href="javascript:readdFile1();" id="replay">重新上传</a>
						<a href="javascript:addFile11();" id="continue"
							style="display: none">继续上传</a>
						<a href="javascript:cancelFile();" id="cancel"
							style="display: none">
							取消上传</a>
					</td>
										</TR>
										<TR>
											<TD>
												&nbsp;
											</TD>
											<TD>
												&nbsp;
											</TD>
											<TD id=submiting>
<!--<s:submit id="submit" cssStyle="login-btn" value="立即发布" />
--><input class="pub-btn" type="submit" name="submit" value="立即发布>>"/>
										</TR>
									</TABLE>
								</s:form>
							</div>
						</DIV>
					</DIV>
				</DIV>
				<!--mainBox end -->
			</DIV>
			<s:include value="include/footer.jsp"></s:include>
	</BODY>
</HTML>
